1. /* sloshftr.cpp by K.Tsuru */
  2. // function ID = 243 DRADIX
  3. /***********************
  4. SLong class
  5. bit shift operator m>>n
  6. It devides by 2^n.
  7. ***********************/
  8. #ifndef SN_H
  9. #include "sn.h"
  10. #endif
  11. SLong operator>>(const SLong& m, ulong n)
  12. {
  13. if(!n || (m.Sign(243) == 0)) return m;
  14. double x = (n < 100L) ? pow(2.0, (int)n) : DBL_MAX; // ver.2.17
  15. if(x < (double)m.SlOpMaxValue()){
  16. ulong d = 1L << (int)n;
  17. return LsDiv(m, d);
  18. }
  19. SLong two(m.Type(), m.MinSize(), 2L); // two = 2;
  20. SLong den = Lpow(two, n);
  21. return m/den;
  22. }

sloshftr.cpp : last modifiled at 2015/11/27 14:26:46(562 bytes)
created at 2017/10/07 10:26:50
The creation time of this html file is 2017/11/09 14:52:03 (Thu Nov 09 14:52:03 2017).